home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2005 July / Macworld CD 17.05.iso / Data / Main.dxr / 00179_searcher.ls < prev    next >
Encoding:
Text File  |  2000-02-28  |  1.8 KB  |  65 lines

  1. global gDB_Table1
  2.  
  3. on new me
  4.   return me
  5. end
  6.  
  7. on beginSprite me
  8.   set the text of field "S Title" to EMPTY
  9.   set the text of field "S Version" to EMPTY
  10.   set the text of field "S Author" to EMPTY
  11.   set the text of field "S Type" to EMPTY
  12.   set the text of field "S Category" to EMPTY
  13.   set the text of field "S Email" to EMPTY
  14.   set the text of field "S URL" to EMPTY
  15.   set the text of field "S Price" to EMPTY
  16.   set the text of field "S Description" to EMPTY
  17. end
  18.  
  19. on mouseUp me
  20.   mSetCriteria(gDB_Table1, "Title", "=", EMPTY)
  21.   t = the text of field "S Title"
  22.   if t <> EMPTY then
  23.     mSetCriteria(gDB_Table1, "or", "Title", "contains", t)
  24.   end if
  25.   t = the text of field "S Version"
  26.   if t <> EMPTY then
  27.     mSetCriteria(gDB_Table1, "or", "Version", "contains", t)
  28.   end if
  29.   t = the text of field "S Author"
  30.   if t <> EMPTY then
  31.     mSetCriteria(gDB_Table1, "or", "Author", "contains", t)
  32.   end if
  33.   t = the text of field "S Type"
  34.   if t <> EMPTY then
  35.     mSetCriteria(gDB_Table1, "or", "Type", "contains", t)
  36.   end if
  37.   t = the text of field "S Category"
  38.   if t <> EMPTY then
  39.     mSetCriteria(gDB_Table1, "or", "Category", "contains", t)
  40.   end if
  41.   t = the text of field "S Email"
  42.   if t <> EMPTY then
  43.     mSetCriteria(gDB_Table1, "or", "Email", "contains", t)
  44.   end if
  45.   t = the text of field "S URL"
  46.   if t <> EMPTY then
  47.     mSetCriteria(gDB_Table1, "or", "URL", "contains", t)
  48.   end if
  49.   t = the text of field "S Price"
  50.   if t <> EMPTY then
  51.     mSetCriteria(gDB_Table1, "or", "Price", "contains", t)
  52.   end if
  53.   t = the text of field "S Description"
  54.   if t <> EMPTY then
  55.     mSetCriteria(gDB_Table1, "or", "Description", "contains", t)
  56.   end if
  57.   mSelect(gDB_Table1)
  58.   if mSelectCount(gDB_Table1) = 0 then
  59.     alert("No products with those criteria found.")
  60.   else
  61.     showProdInfo(1)
  62.     go("Shareware")
  63.   end if
  64. end
  65.